package com.lx.oms.controller.service.impl;

import java.math.BigInteger;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lx.oms.common.entity.R;
import com.lx.oms.common.utils.CommonUtils;
import com.lx.oms.controller.entity.WOrderCategoryEntity;
import com.lx.oms.controller.manager.WOrderCategoryManager;
import com.lx.oms.controller.service.WOrderCategoryService;

/**
 * 微信下单多个分类重量
 *
 * @author houzhong
 * @date 2018年8月08日 上午10:44:31
 */
@Service("wOrderCategoryService")
public class WOrderCategoryServiceImpl implements WOrderCategoryService {

	@Autowired
	private WOrderCategoryManager wOrderCategoryManager;

	@Override
	public List<WOrderCategoryEntity> listWOrderCategory(WOrderCategoryEntity categoryEntity) {
		List<WOrderCategoryEntity> list = wOrderCategoryManager.listWOrderCategory(categoryEntity);
		return list;
	}

	@Override
	public R saveWOrderCategory(WOrderCategoryEntity role) {
		int count = wOrderCategoryManager.saveWOrderCategory(role);
		return CommonUtils.msg(count);
	}

	@Override
	public R getWOrderCategoryById(BigInteger id) {
		WOrderCategoryEntity wOrderCategory = wOrderCategoryManager.getWOrderCategoryById(id);
		return CommonUtils.msg(wOrderCategory);
	}

	@Override
	public R updateWOrderCategory(WOrderCategoryEntity wOrderCategory) {
		int count = wOrderCategoryManager.updateWOrderCategory(wOrderCategory);
		return CommonUtils.msg(count);
	}

	@Override
	public R batchRemove(String[] id) {
		int count = wOrderCategoryManager.batchRemove(id);
		return CommonUtils.msg(id, count);
	}

}
